/*
 * Copyright 2008 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package com.google.gwt.dev.jjs;

import com.google.gwt.core.ext.TreeLogger;
import com.google.gwt.core.ext.UnableToCompleteException;
import com.google.gwt.dev.Permutation;
import com.google.gwt.dev.javac.CompilationState;
import com.google.gwt.dev.jjs.PermutationResult;
import com.google.gwt.dev.jas.*;
import com.google.gwt.dev.jas.as.*;
import com.google.gwt.dev.jas.as.impl.*;
import com.google.gwt.jas.linker.FlashImportsArtifact;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * Represents a unified, non-permutation specific AST. This AST is used to drive
 * per-permutation compiles.
 */
public class UnifiedAstJas extends UnifiedAst {

  private FlashImportsArtifact flashImportsArtifact;

  public UnifiedAstJas(UnifiedAst other) {
    super(other);
  }

  public UnifiedAstJas(UnifiedAst result,
      FlashImportsArtifact flashImportsArtifact) {
    super(result);
    this.flashImportsArtifact = flashImportsArtifact;
  }

  @Override
  public PermutationResult compilePermutation(TreeLogger logger,
      Permutation permutation) throws UnableToCompleteException {
    return JavaToActionScriptCompiler.compilePermutation(logger, this,
          permutation);
  }

  public FlashImportsArtifact getFlashImportsArtifact() {
    return flashImportsArtifact;
  }
}
